<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class CommentModel extends Model
{
    use HasFactory;
    protected $table = 'comment';
    protected $primaryKey = 'comment_id';
    protected $keyType = 'int';
    public $incrementing =true;
    public $timestamps = true;
    protected $fillable=[
        'content',
        'user_id',
        'blog_id',
    ];
    public function blog(){
        return $this->belongsTo('App\Models\BlogModel','comment_id', 'blog_id');
    }
    public function user(){
        return $this->belongsTo('App\Models\UserModel','comment_id', 'user_id');
    }
}
